package com.incom.log.server.conf.redis;

import com.incom.log.server.conf.MqConfig;

/**
 * redis config
 */
public class RedisConfig implements MqConfig {

    private String host = "localhost";
    private int port = 6379;
    private String password = null;
    private int dbindex = 0;
    private String key = "systemlog";
    private int timeout = 10000;
    private String serviceNanme;

    public RedisConfig() {
        this("systemlog");
    }

    public RedisConfig(String serviceName) {
        this.serviceNanme = serviceName;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getDbindex() {
        return dbindex;
    }

    public void setDbindex(int dbindex) {
        this.dbindex = dbindex;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }


    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getServiceNanme() {
        return serviceNanme;
    }

    public void setServiceNanme(String serviceNanme) {
        this.serviceNanme = serviceNanme;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("RedisConfig{");
        sb.append("host='").append(host).append('\'');
        sb.append(", port=").append(port);
        sb.append(", password='").append(password).append('\'');
        sb.append(", dbindex=").append(dbindex);
        sb.append(", key='").append(key).append('\'');
        sb.append(", timeout=").append(timeout);
        sb.append(", serviceNanme='").append(serviceNanme).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
